package demo01Object;

public class demo02 {

    public void way01(){
        demo02Zi p1 = new demo02Zi("古力娜扎", 19);
        demo02Zi p2 = new demo02Zi("迪利纳扎", 19);

        System.out.println("p1地址值："+p1.toString());//Demo01Object.demo02Zi@2133c8f8
        System.out.println("p2地址值："+p2.toString());//Demo01Object.demo02Zi@43a25848

        System.out.println(p1.equals(p2));

        // 将p1和p2指针指向同一个地址
        p1 = p2;
        System.out.println(p1.equals(p2));
    }

}
